home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / D-G / FORTRAN Goodies / FORTRAN Macros for EXCEL / Source Code / DataC.f < prev    next >
Encoding:
Text File  |  1992-01-31  |  1.0 KB  |  50 lines  |  [TEXT/MPS ]

  1. !!MP Inlines.f
  2.  
  3. C        An example of a FORTRAN Resource for Microsoft Excel 3.0
  4. C    This example call illustrates the use of zero terminated
  5. C    strings - Data Type C. This resource returns the length of
  6. C    zero terminated string. This does not handle strings with a 
  7. C    length of greater than 32767.
  8. C
  9. C    Testing for this example was done with
  10. C    Language Systems FORTRAN version 3.0
  11. C    
  12. C    Below are the commands that were executed to create the 
  13. C    code resource
  14.  
  15. !!IFC FALSE
  16.  FORTRAN DATAC.f -opt=1 -noimplicit
  17. Link -w -f -srt -ad 4 -t '????' -c '????' ∂
  18. -m DATAC -sn Main=DATAC ∂
  19. -sn f_RunTime=DATAC ∂
  20. -sn f_Intrinsics=DATAC ∂
  21.     DATAC.f.o ∂
  22.     "{FLibraries}"OutpwStubs.o ∂
  23.     "{Libraries}"Runtime.o ∂
  24.     "{Libraries}"Interface.o ∂
  25.     "{FLibraries}"FORTRANlib.o ∂
  26.     "{FLibraries}"IntrinsicLib.o ∂
  27.     "{FLibraries}"FSANELib.o ∂
  28.     -o DATAC.rsc
  29.  
  30. !!ENDC
  31.  
  32. C    Source code
  33.  
  34.     integer*2 function DATAC(%val(a))
  35.     
  36.     integer where
  37.     pointer /character*32767/ a
  38.  
  39.     where = index(a^,char(0))
  40.     if (where.EQ.0) then
  41.         DATAC = INT2(NAN(1))
  42.     else
  43.         DATAC = where - 1
  44.     endif
  45.     
  46.     return
  47.     end
  48.     
  49.         
  50.